package com.augurit.common.system.service.org.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.augurit.common.dao.AtLoginCheckDao;
import com.augurit.common.system.service.org.IAtLoginCheckService;
import com.augurit.common.system.web.org.form.AtLoginCheckForm;

/**
 * 登录检测逻辑实现类
 */
@Service
@Transactional
public class AtLoginCheckServiceImpl implements IAtLoginCheckService {
	
	// DAO 引用
	@Autowired
	private AtLoginCheckDao atLoginCheckDao; //应用DAO类


	@Transactional(readOnly = true)
	public AtLoginCheckForm get(Long id){
		return atLoginCheckDao.getForm(id);
	}

	/**
	 * 保存业务字典项Form对象
	 * @param form Form对象
	 */
	public void save(AtLoginCheckForm form){
		atLoginCheckDao.save(form);
	}
	
	/**
	 * 保存业务字典项Form对象数组
	 * @param forms Form对象数组
	 */
	public void save(AtLoginCheckForm[] forms){
		if(forms != null && forms.length > 0){
			for(AtLoginCheckForm form : forms)
				atLoginCheckDao.save(form);
		}
	}

	/**
	 * 根据主键ID删除业务字典项对象
	 * @param id 业务字典项对象主键ID
	 */
	public void delete(Long id) {
		if(id != null)
			atLoginCheckDao.delete(id);
	}
	
	/**
	 * 根据主键ID集合删除多个业务字典项对象
	 * @param ids 业务字典项主键ID集合
	 */
	public void delete(Long[] ids) {
		if(ids != null && ids.length > 0)
			atLoginCheckDao.delete(ids);
	}

}
